package com.qili.service.jc;

import com.qili.base.service.BaseService;
import com.qili.entity.jc.JcProject;
import com.qili.entity.jc.JcProjectMilepost;
import com.qili.entity.jc.JcProjectStage;
import com.qili.entity.jc.dto.JcProjectDTO;
import com.qili.entity.zx.ZxProjectMilepost;
import com.qili.entity.zx.ZxProjectStage;
import com.qili.entity.zx.dto.ZxProjectDTO;
import com.qili.util.JsonUtil;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;

/**
 * @author zhaoyongke
 * @date 2021/6/24
 * @description
 */
public  interface JcProjectService extends BaseService<JcProject, String> {
    void addPalce(JcProjectDTO jcProjectDTO) throws Exception;
    int deleteProjectsFromRecycle(String[] id);
    /**
     * @Author:zhaoyongke
     * @Description: 查询项目
     * @param dto
     * @Date:15:48 2020/11/26
     */
    List<JcProjectDTO> selectJcProject(JcProjectDTO dto);


    List<JcProjectDTO> selectJcListApp(JcProjectDTO dto);
    /**
     * @Author:zhaoyongke
     * @Description: 查询项目
     * @param dto
     * @Date:15:48 2020/11/26
     */
    List<JcProjectDTO> selectSupervisorProject(JcProjectDTO dto);
    public JsonUtil del(String id);
    /* *
     * @Author liuyang
     * @Date 18:13 2020/12/5
     * @Description             里程完成后更改项目状态
     * @Param projectId         项目id
     * @Param newStatus         新状态
     * @return void
     */
    void updateProjectStatusAfterMilepostFinish(JcProjectMilepost milepost);
    /* *
     * @Author liuyang
     * @Date 18:13 2020/12/5
     * @Description             阶段完成后更改项目状态
     * @Param projectId         项目id
     * @Param newStatus         新状态
     * @return void
     */
    void updateProjectStatusAfterStageFinish(JcProjectStage stage);

    /* *
     * @Author liuyang
     * @Date 11:05 2020/12/6
     * @Description
     * @Param obj       如果是阶段完成事件,这里传过来的是阶段对象,如果是里程完成,阶段未完成,这里传过来的是里程对象
     * @return void
     */
    BigDecimal calProgress(Object obj) throws ParseException;

    JcProjectDTO getOldProjectInfo(JcProjectDTO oldProjectInfo);

    void compareProject(JcProjectDTO oldProjectInfo, JcProjectDTO supervisorProjectDTO, String userId);
    /**
     * 验证某监理文件是否是必选的
     * @param jcProjectDTO
     * @return      必选的返回true否则返回false
     */
    boolean checkFileNecessary(JcProjectDTO jcProjectDTO);

    public String getUserRole(String fileId);

    //通过阶段和里程 获取 里程结束时间
    String getPayMiseNoDate(JcProjectStage stage, JcProjectMilepost milepost);

    List<JcProjectDTO>  selectProFinishLv(JcProjectDTO dto);

    /**
     * @Author:zhaoyongke
     * @Description: 查询项目
     * @param dto
     * @Date:15:47 2020/11/26
     */
    List<JcProjectDTO> selectJcTjProject(JcProjectDTO dto);
    void resetProgress(String id);
}
